using UnityEngine;
using System.Collections;
using System;

/// 广告基类
public class AdsBase : TJLogger
{
	protected Action<bool> splashCallBack = null;
	protected Action<bool> bannerCallBack = null;
	protected Action<bool> insertCallBack = null;
	protected Action<bool> incentCallBack = null;
	protected Action<bool> videoCallBack = null;
	protected Action<bool> nativeCallBack = null;
	protected AndroidJavaObject jo = null;

	/// 广告平台标记
	public class AdsTags{
		/// 广点通
		public const string gdt = "Gdt";
		/// 阿里
		public const string ali = "Ali";
		/// Applovin
		public const string applovin = "Applovin";
		/// Vungle
		public const string vungle = "Vungle";
		/// 联想
		public const string lestore = "Lestore";
		/// Oppo
		public const string oppo = "Oppo";
		/// 玉米
		public const string yumi = "Yumi";
	}

	/// 广告类型
	public class AdsTypes{
		/// 开屏
		public const string splash = "Splash";
		/// 横幅
		public const string banner = "Banner";
		/// 插屏
		public const string insert = "Insert";
		/// 激励视频
		public const string incent = "Incent";
		/// 视频
		public const string video = "Video";
		/// 原生
		public const string native = "Native";
	}

	/// 广告状态
	public class AdsStates{
		/// 收到
		public const string recive = "onADReceive";
		/// 无广告
		public const string noAD = "onNoAD";
		/// 打开
		public const string open = "onADOpened";
		/// 曝光
		public const string exposure = "onADExposure";
		/// 点击
		public const string click = "onADClick";
		/// 关闭
		public const string closed = "onADClosed";
		/// 错误
		public const string error = "onADError";
	}

	/// Banner位置（上、下）
	public enum BannerPos{
		/// 屏幕下方
		down = 0,
		/// 屏幕上方
		up = 1
	};
	/// Banner宽度（自适应、充满）
	protected enum BannerwWidth{
		/// 自适应
		wrap = 0,
		/// 充满
		fill = 1
	};

	public virtual void Init (params string[] key){
		TJLogError("请重载 Init 方法");
	}

	#region  展示 开屏、横幅、原生、插屏、激励视频、插屏视频
	/// 开屏广告
	public virtual void ShowSplash (Action<bool> ac = null){
		TJLogError("请重载 ShowSplash 方法");
	}

	/// 展示Banner广告
	public virtual void ShowBanner (Action<bool> ac = null){
		TJLogError("请重载 ShowBanner 方法");
	}

	/// 关闭Banner广告
	public virtual void CloseBanner (){
		TJLogError("请重载 CloseBanner 方法");
	}
	/// 展示原生广告
	public virtual void ShowNative (Action<bool> ac = null){
		TJLogError("请重载 ShowNative 方法");
	}

	/// 关闭原生广告
	public virtual void CloseNative (){
		TJLogError("请重载 CloseNative 方法");
	}

	/// 插屏广告（图）
	public virtual void ShowInsert (Action<bool> ac = null){
		TJLogError("请重载 ShowInsert 方法");
	}

	/// 激励视频广告
	public virtual void ShowIncent (Action<bool> ac = null){
		TJLogError("请重载 ShowIncentVideo 方法");
	}

	/// 插屏视频（视频）
	public virtual void ShowInsertVideo (Action<bool> ac = null){
		TJLogError("请重载 ShowInsertVideo 方法");
	}

    #endregion

    #region 加载视频和插屏

	public virtual void LoadInsert (){
		TJLogError("请重载 LoadInsert 方法");
	}

	public virtual void LoadIncent (){
		TJLogError("请重载 LoadIncentVideo 方法");
	}

    #endregion

    #region 判断广告状态

	public virtual bool IsBannerReady (){
		TJLogError("请重载 IsBannerReady 方法");
		return false;
	}

	public virtual bool IsInsertReady (){
		TJLogError("请重载 IsInsertReady 方法");
		return false;
	}

	public virtual bool IsIncentReady (){
		TJLogError("请重载 IsIncentiReady 方法");
		return false;
	}

	public virtual bool IsInsertVideoReady (){
		TJLogError("请重载 IsInsertVideoReady 方法");
		return false;
	}

    #endregion

	public virtual void OnADCallback (string ev){
		TJLogError("请重载 AdsCallback 方法");
	}
}
